<?php
include '../JHeader.php';
require('../help_funcs.php');
/*
 * Serie löschen
 */

$delete_id = $_GET['id'];

if(isset($_POST['confirm']))
{
    $delete = $_POST['confirm'];

    require_once('../Database/Database.php');
    $db = new Database();
    $db->Connect();
    $db->Delete('Series', 'ID_Series = \'' . $delete . '\'');
    // TODO: Alle Tabellen der Serie löschen..
    $db->Disconnect();
}
else if(HasAccessToSeries($jid, $delete_id))
{
    echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">';
    echo 'Wirklich löschen?<br />';
    echo '<input type="hidden" name="confirm" value="' . $delete_id . '" />';
    echo '<input type="submit">';
}
?>
